package com.dm.learn.threads.threadpool;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

public class ThreadPoolTask implements Runnable {
    private static AtomicInteger number = new AtomicInteger(0);
    public int taskId = number.addAndGet(1);

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + " task:" + taskId + " start...");
        try {
            TimeUnit.MILLISECONDS.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName() + " task:" + taskId + " end...");
    }
}
